/**
 * Copyright 2009 by Christian Scheid. This file is part of the switch eclipse plugin and is licensed under the
 * GPL version 3. Please refer to the URL http://www.gnu.org/licenses/gpl-3.0.html for details.
 */
package org.digitalsoul.switchplugin.matchers;

import org.digitalsoul.switchplugin.model.ISwitchFile;



public class FileExtensionMatcher extends Matcher {

    private final String extension;

    public FileExtensionMatcher (String extension) {
        this.extension = extension;
    }
    
    @Override
    public boolean performMatch(ISwitchFile file) {
        return file.getFileExtension().equalsIgnoreCase(extension);
    }
    
    @Override
    public String toString() {
        return extension;
    }

    @Override
    public MatcherType getType() {
        return MatcherType.EXTENSION;
    }
}
